home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_jep_exteriorambient.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  81 lines

  1. # Jones 3D Cog Script
  2. #
  3. # olv_exteriorambient.cog
  4. #
  5. # Plays random sounds at random locations
  6. #
  7. # [DS]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message    pulse
  14.     message    startup
  15.     message    entered
  16.  
  17.     thing        soundPos0        nolink
  18.     thing        soundPos1        nolink
  19.     thing        soundPos2        nolink
  20.     thing        soundPos3        nolink
  21.     thing        soundPos4        nolink
  22.     thing        soundPos5        nolink
  23.     thing        soundPos6        nolink
  24.     thing        soundPos7        nolink
  25.  
  26.     sector    turn_on_sec
  27.     sector    turn_off_sec
  28.     int        on_startup=0                # set to 1 to start on startup.    
  29.  
  30.     sound        wav0=olv_outside_a01.wav        local
  31.     sound        wav1=olv_outside_a02.wav        local
  32.     sound        wav2=olv_outside_a03.wav        local
  33.     sound        wav3=olv_outside_a04.wav        local
  34.     sound        wav4=olv_outside_a05.wav        local
  35.     sound        wav5=olv_outside_a06.wav        local
  36.     sound        wav6=gen_sg_squawk.wav            local
  37.     sound        wav7=olv_outside_a08.wav        local
  38.     thing        player                    local
  39.     float        minDist=5                local
  40.     float        maxDist=35                local
  41.     float        volume=0.8                local
  42.     int        sndnum                local
  43.     int        numsounds=8                local
  44.     int        numlocl=8                local        
  45.     int        cnt                    local
  46.  
  47. end
  48.  
  49. code
  50.  
  51. # ........................................................................................
  52.  
  53. startup:
  54.     player=GetLocalPlayerThing();
  55.     if(on_startup == 1)
  56.     {
  57.     setpulse(1.0);
  58.     }
  59.     return;
  60.  
  61. entered:
  62.     if(getSenderRef() == turn_on_sec)
  63.     {
  64.     setpulse(1.0);
  65.     }
  66.     if(getSenderRef() == turn_off_sec)
  67.     {
  68.     setpulse(0.0);
  69.     }
  70.     return;
  71.  
  72.  
  73. pulse:
  74.     sndnum = rand()*numsounds;
  75.     cnt = rand()*numlocl;
  76. #    printint(sndnum);
  77.     PlaySoundThing(wav0[sndnum], soundPos0[cnt], volume, minDist, maxDist, 0);
  78.     return;
  79.  
  80.  
  81. end